import request from '@/utils/request'

// 查询知识库文档列表
export function listDocument(query) {
  return request({
    url: '/business/document/list',
    method: 'get',
    params: query
  })
}

export function addToSegment(data) {
  return request({
    url: '/business/document/addToSegment',
    method: 'post',
    data: data
  })
}


// 查询知识库文档详细
export function getDocument(id) {
  return request({
    url: '/business/document/view/' + id,
    method: 'get'
  })
}

// 新增知识库文档
export function addDocument(data) {
  return request({
    url: '/business/document/add',
    method: 'post',
    data: data
  })
}

// 修改知识库文档
export function updateDocument(data) {
  return request({
    url: '/business/document/update',
    method: 'put',
    data: data
  })
}

// 删除知识库文档
export function delDocument(id) {
  return request({
    url: '/business/document/delete/' + id,
    method: 'delete'
  })
}
